/*
 * @Author: your name
 * @Date: 2020-09-01 14:38:51
 * @LastEditTime: 2020-09-01 15:30:48
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /express/src/decorator/use.ts
 */
import 'reflect-metadata';
import { RequestHandler } from 'express';
import { CrowllerController, LoginController } from '../controller';

export function use(middleware: RequestHandler) {
  return function(target: CrowllerController | LoginController, key: string) {
    Reflect.defineMetadata('middleware', middleware, target, key);
  };
}
